#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QEvent>
#include <QKeyEvent>

#include <QProgressBar>
#include <QSpinBox>
#include <QFontComboBox>
#include <QLabel>

#include "dragabletab.h"
#include "sshcreateguide.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

// 主UI界面,继承于 QMainWindow
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget* parent = nullptr);
    ~MainWindow();

private:
    // UI相关布置
    void buildUi();
    // Widget相关信号槽
    void buildWidgetSignalSlots();
    // action相关信号槽connect
    void buildActionSignalSlots();
    // 相关信号槽
    void BuildTextPageActionSignalSlots(QWidget* content, DragableTab::TabType type);
    // 计时器, 测试用
    void timerEvent(QTimerEvent* event) override;
    int mTimerId = -1;
    int counts = -1;

    Ui::MainWindow* ui {nullptr};
    QSpinBox* mSpinFontBox {nullptr};
    QFontComboBox* mFontComboBox {nullptr};
    // 各个页面的相关monitor
    QWidget* mStatusMonitor {nullptr};
    // ssh导航
    SshCreateGuide* mSshCreateGuide {nullptr};

private slots:
    void onClickActionCreateSlot();
    void onClickActionOpenSlot();
    void onClickACtionCreateNewSsh();
    void onClickActionSaveSlot();
    void onClickActionSaveAsSlot();

    void onClickActionSetFont();
    void onClickActionBoldSlot(bool checked);
    void onClickActionItalicSlot(bool checked);
    void onClickActionUnderlineSlot(bool checked);

    void onClickActionClosePageSlots();
    void OnFocusPageChangedSlots();
};
#endif // MAINWINDOW_H
